//
//  TestTbvc.m
//  初始通用工程
//
//  Created by xhq on 2019/4/17.
//  Copyright © 2019 xhq. All rights reserved.
//

#import "TestTbvc.h"

@interface TestTbvc ()

@end

@implementation TestTbvc

- (void)viewDidLoad {
    [super viewDidLoad];
    

    NSMutableArray *arrM =[NSMutableArray array];
    for (int i = 0; i < 20; i++) {
        NSString *str = @"我";
        for (int j = 0; j < i; j++) {
            str = [str stringByAppendingString:@"我"];
        }
        [arrM addObject:str];
        
    }
    self.dataArrayM =arrM;
    [self.tableView reloadData];
    // Do any additional setup after loading the view.
}

- (UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    static NSString *cellId = @"TableViewCellIdx";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellId];
    if (cell == nil){
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellId];
        cell.selectionStyle =UITableViewCellSelectionStyleNone;
    }
    cell.textLabel.text = self.dataArrayM[indexPath.row];
    
    return cell;
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    
    UIViewController *vc= [TestTbvc new];
    vc.title = self.dataArrayM[indexPath.row];
    [self.navigationController pushViewController:vc animated:YES];
}
@end
